// 伤害算法
const SVE = require('../common/base-tool');

class Damage {
    constructor() {}

    // 计算基础伤害
    receive_damage(type, damage, me, victim, ) {
        let val;
        // let def = me.temp.armor;
        // 缺少：装备值算法
        let def = 865;
        if (def >= 2000) def = 2000;

        if( type!="jing" && type!="qi" && type!="jingli" && type!="neili") return {"F_DAMAGE": "伤害种类错误。"};

        // 最终伤害来自谁
        me.temp.last_damage_from = victim.name;

        if(type=="qi") val = damage + damage* 1000/(100+ def);

        if( val < 0 ) val = -1;

        return Math.floor(val);
    }
}

module.exports = Damage;